home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 090 / inkey.arc / INKEY.DOC < prev   
Text File  |  1987-10-03  |  5KB  |  116 lines

  1.                                Inkey 1.1
  2.                          Copyright (c) 1985 by
  3.                             Unique Software
  4.                             P.O. Box 26613
  5.                         Fort Worth, Texas 76126
  6.                          CompuServe 70130,330
  7.                       American People Link OKS688
  8.                            MCI MAIL 252-8689
  9.  
  10.                             What is INKEY?
  11.  
  12.     INKEY  is  a handy tool for your BATch files.  With INKEY you  can
  13. allow a user to press not only "Y" and "N", like several utilities you
  14. may have seen,  but also any other KEYS you may choose.  Therefore you
  15. could even build a menu in a BATch file.  INKEY can also simulate  the
  16. ECHO command and send ANSI sequences for making INKEY colorful.  INKEY
  17. can simulate the PAUSE statement, allowing you to press any key.
  18.  
  19.                              INKEY format
  20.  
  21.      INKEY [options] [[\|/]prompt] [;]
  22.        [options]
  23.          ! any keypress is acceptable
  24.          @ no keypress is needed (behave like ECHO)
  25.          ^(A-Z) keypress may be CTRL (A-Z)
  26.          characters = keypress must be one of these or above
  27.          [all letter keypresses are upper-cased]
  28.        [[\|/]prompt]
  29.          ~ translated to ESCape, ASCII 27
  30.          /prompt - prompt is flush left
  31.          \prompt - prompt is centered
  32.        [;] no ending CR LF sequence
  33.  
  34.         examples:
  35.           INKEY !/Press any key to continue... (simulate PAUSE)
  36.           INKEY !\Press a key to proceed ...  (centered on screen)
  37.           INKEY !/Press any key to FORMAT disk in drive A:
  38.           The "!" makes any key pressed valid.
  39.  
  40.           INKEY @    (generate a blank line)
  41.           INKEY @/Option Menu:
  42.           The "@" makes INKEY perform like ECHO.
  43.  
  44.           INKEY ^U/Press CTRL-U to continue
  45.           INKEY ^F\Press CTRL-F to continue  (centered)
  46.           The "^" preceding any alpha character makes the valid
  47.               keypress a control-key combination.
  48.  
  49.           INKEY DKI/[D]elete, [K]eep, or more [I]nformation
  50.           INKEY YN/Would you like to continue [Y?N]
  51.           INKEY 12/Format 1 or 2 drives?
  52.           Any other alphanumeric keys are the valid keypresses for
  53.               INKEY.
  54.  
  55.           INKEY @/This message will be on one line;
  56.           INKEY @/with ~[34mBlue and ~[31mRed.
  57.           A terminating ";" on the prompt prevents a new line
  58.             from being generated at the end of a prompt.
  59.           And if you have an ANSI.SYS driver loaded the tilde, "~" is
  60.               translated into an ESCape so that you can send ANSI
  61.               sequences.
  62.  
  63.                     What good does the keypress do?
  64.  
  65.     INKEY  returns  the  ASCII value of the keypress as an  DOS  error
  66. code.   This error code can be determined within a BATch file with the
  67. ERRORLEVEL command and then branch with the GOTO command. For example:
  68.           INKEY DKI/[D]elete, [K]eep, or more [I]nformation
  69.           IF ERRORLEVEL=75 GOTO keep
  70.           IF ERRORLEVEL=73 GOTO info
  71.           IF ERRORLEVEL=4  GOTO delete
  72.     WARNING:  ERRORLEVEL checks should be done from the HIGHEST  ASCII
  73. value to the LOWEST.  If we tested 'ERRORLEVEL=4'  first in the  above
  74. example, the BATch file would ALWAYS branch to the label ':delete'
  75.  
  76.                  Replaceable paramters in BATch files
  77.  
  78.     INKEY is compatible with the BATch handler in DOS. That is to say,
  79. you can include the replaceable parameters,  e.g. %4, within the INKEY
  80. prompt  string and they will be printed out as within any batch  file.
  81. For example:
  82.     INKEY @/%1 should not be run until later.
  83.     in a BATch file called RUN.BAT and the user types:
  84.     RUN PROGRAM
  85.     then INKEY will display
  86.     PROGRAM should not be run until later.
  87.  
  88.     For  more information on BATch files and ANSI sequences  see  your
  89. DOS manual.
  90.  
  91.                             Quick Reference
  92.  
  93.     For quick reference just type "INKEY" at your DOS prompt.
  94.  
  95.                      Shareware and Unique Software
  96.  
  97.     The   files   contained  herein are distributed on  two  concepts.
  98. The   first  concept,   the  Shareware concept,   provides  that  this
  99. software is to be freely distributed in an un-modified state.  You are
  100. encouraged to copy,   give,  upload any of our un-modified software to
  101. any  person,   bulletin board or entity.   The second  concept,     we
  102. call   "Aware",    is that Unique Software should   provide  valuable,
  103. useful,  and/or entertaining software, programming techniques,  and/or
  104. information.
  105.     The first concept works only if the second concept is fulfilled by
  106. us.    We do  not require or set a "donation."   We do not  distribute
  107. software  and expect "charity"   in return.   Instead,   we only  want
  108. payment from those who feel that our software, programming techniques,
  109. and/or  information  is valuable,  useful,  and/or entertaining.   The
  110. amount? How valuable, useful,  and/or entertaining is it to you?
  111.     We  only ask two things from our users.   First,   that you foward
  112. your  name and  address with any payment you might make.   (This  will
  113. enable us to  inform you of any upgrade  or bugs found.)   Along  with
  114. any suggestions or comments on the program. Second, Enjoy!
  115.  
  116.